import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-11-25
 * Time: 17:32
 */
public class Test {
    public static void main(String[] args) {
        LinkedList<Integer> linkedList=new LinkedList<>();
        linkedList.add(5);
        linkedList.add(5);
        linkedList.add(5);
        linkedList.add(5);
        linkedList.add(6);
        Iterator<Integer> it= linkedList.listIterator();
        while(it.hasNext()){
            System.out.print(it.next()+" ");
        }
    }
}
